home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 114 / macaddict114.cdr / Software / Internet & Communication / IOXWebcamX-1.1.dmg / IOXWebcamX-1.1.pkg / Contents / Resources / IOXpertsUninstaller.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2005-05-05  |  24.4 KB  |  949 lines

  1. #!/bin/sh +x
  2. #
  3. # IOXperts Uninstaller.sh
  4. #
  5. # Written by : Ian Keck        Dec 2004-Jan 2005
  6. #
  7. #
  8. # Usage: IOXpertsUninstaller <method> [-volume <volumeName>] [-bin <bindir>] [-scripts <scriptdir>] [-show] [-installer] [-verbose] <itemToRemove> ...
  9. #
  10. # Valid methods are: trash, mvmac, remove, show
  11. #    trash                    uses a tool to move files to the trash, appending 'copy <n>' as appropriate
  12. #   mvmac                    uses mvmac to move files to the trash, but currently doesn't append 'copy <n>' to the names.
  13. #    remove                    uses the rm command
  14. #   show                    lists the files to be removed
  15. #
  16. # Options are as follows
  17. #    -volume <volumename>    remove products on volume named /Volumes/<volumename>, default = boot volume
  18. #                            NOTE - trash methods may not work, remove and show options should work.
  19. #    -bin    <bindir>        location of bin directory - containing all tools needed by the removal script - default is .
  20. #    -scripts <scriptdir>    location of scripts dir - containing all scripts that need to be sourced - default is .
  21. #    -show                    echo commands that would be performed instead of performing them
  22. #    -installer                uninstaller is running in the installer
  23. #    -verbose                echo more stuff
  24. #    -removeprefs            remove preference files for specified components
  25. #    -clearprefs                erase specific preferences for specified components
  26. #    -removeinstaller        remove installer receipts for specified components
  27. #
  28. # Names of items which may be removed
  29. #
  30. #    The following names are composite items
  31. #        webcam, usbwebcam = ioxperts usb webcam drivers
  32. #        iidc              = ioxperts iidc firewire drivers
  33. #        wireless          = ioxperts wireless drivers
  34. #        still              = ioxperts still camera drivers
  35. #        industrial          = ioxperts industrial camera drivers
  36. #        logitech          = logitech webcam drivers
  37. #        stmicro              = stmicro still drivers
  38. #        ioxperts          = webcam, iidc, wireless, still and industrial
  39. #        all                  = ioxperts and logitech
  40. #
  41. #    The following names are individual items
  42. #        shared              = video shared
  43. #        register          = purchase and register
  44. #        dm                  = dm
  45. #        sgpanel              = sgpanel
  46. #        codecs              = standard ioxperts codecs
  47. #        industrial-codecs  = bayer codecs
  48. #        video-kexts          = ioxperts video kext
  49. #        logitech-kexts      = logitech kexts
  50. #        webcam-vdigs
  51. #        iidc-vdigs
  52. #        industrial-vdigs
  53. #        logitech-vdigs
  54. #        wireless-kexts
  55. #        still-capture
  56. #        stmicro-still-capture
  57. #        
  58. #
  59. #
  60. # --------------------------------------------------------------------------
  61. # Required Tools
  62. #
  63. #    MoveToTrash
  64. #    MvMac
  65. #    KillDeviceMonitor
  66. #   KillSessionMonitor
  67. #    ComponentTool
  68. #
  69. # Required Scripts
  70. #    UninstallerTools.sh
  71. #
  72. # Unix Tools
  73. #   rm
  74. #    kill
  75. #    ls
  76. #    echo
  77. #   sed
  78. #
  79. # ---------------------------------------------------------------------------
  80. #
  81. # Expected Behavior
  82. #    In an installer      - remove everything that will conflict with what will be replacing it.
  83. #    Outside an installer - only allow top level - composite components
  84. #                         - don't remove components shared by other installed components.
  85. #    Remove                 - doesn't fail if something isn't there.
  86. #    Test for IsInstalled - if only one item of a subsystem is there it's installed for the purposes
  87. #                           of the uninstaller
  88. #
  89. # Problems - need to be able to determine what is installed.
  90. #           - need to be able to determine what not to remove - those items used by other installed components.
  91. #           - can do all this in sh, easier to do in python.
  92. #
  93. #
  94. # ---------------------------------------------------------------------------
  95. #
  96. # TODO - write a function that saves a copy of device keys to ~
  97. # TODO - write a script that restores these device keys from ~
  98. # TODO - move files to trash in structure corresponding to the installation structure.
  99. #         how would this work with multiple installs and 'copy <n>' appended?
  100. # TODO - move to appropriate trash on another boot volume - may need to specify user and trash folder explicitly
  101. #
  102.  
  103. # echo commands off  (set -v echos commands, set +v doesn't)
  104. # xtrace on  (set -x shows what was executed, set +x doesn't)
  105.  
  106. # ----------------------------------------------------------------------
  107. # Process Args
  108.  
  109. HOW=$1
  110. WHAT=()
  111. VOLUME=""
  112. BINDIR=""
  113. SCRIPTDIR="."
  114. VERBOSE=0
  115. SHOW=0
  116.  
  117. INSTALLER=0
  118. OPTION_REMOVE_INSTALLER=0
  119. OPTION_REMOVE_PREFERENCES=0
  120. OPTION_CLEAR_PREFERENCES=0
  121.  
  122. # -----------------------------------------------------------------------
  123.  
  124. shift
  125. while (( 0 < $# ))
  126. do
  127.     arg="$1"
  128.     
  129.     if [[ "${arg}" == "-volume" || "${arg}" == "-v" ]]
  130.     then
  131.         shift
  132.         VOLUME="$1"
  133.         
  134.     elif [ "${arg}" == "-bin" ]
  135.     then
  136.         shift
  137.         BINDIR="$1"
  138.         
  139.     elif [ "${arg}" == "-scripts" ]
  140.     then
  141.         shift
  142.         SCRIPTDIR="$1"
  143.         
  144.     elif [ "${arg}" == "-installer" ]
  145.     then
  146.         INSTALLER=1
  147.         
  148.     elif [ "${arg}" == "-removeinstaller" ]
  149.     then
  150.         OPTION_REMOVE_INSTALLER=1
  151.         
  152.     elif [ "${arg}" == "-removeprefs" ]
  153.     then
  154.         OPTION_REMOVE_PREFERENCES=1
  155.         
  156.     elif [ "${arg}" == "-clearprefs" ]
  157.     then
  158.         OPTION_CLEAR_PREFERENCES=1
  159.         
  160.     elif [[ "${arg}" == "-show" || "${arg}" == "-showonly" ]]
  161.     then
  162.         SHOW=1
  163.         
  164.     elif [ "${arg}" == "-verbose" ]
  165.     then
  166.         VERBOSE=1
  167.         
  168.     else
  169.         # add arg to list of what to take action on.
  170.         WHAT=( "${WHAT[@]}" "${arg}" )
  171.     fi
  172.     
  173.     shift
  174. done
  175.  
  176. # -----------------------------------------------------------------------
  177.  
  178. if [ "${#WHAT}" -eq 0 ]
  179. then
  180.     echo "No uninstall specified"
  181.     exit 1
  182. fi
  183.  
  184. if [ -z "${SCRIPTDIR}" ]
  185. then
  186.     SCRIPTDIR="."
  187. fi
  188.  
  189. if [ -z "${BINDIR}" ]
  190. then
  191.     BINDIR="${SCRIPTDIR}"
  192. fi
  193.  
  194. if [ "${OPTION_REMOVE_PREFERENCES}" -ne 0 ]
  195. then
  196.     OPTION_CLEAR_PREFERENCES=0
  197. fi
  198.  
  199. if ! [ -z "${VOLUME}" ]
  200. then
  201.     VOLUME="/Volumes/${VOLUME}"
  202. fi
  203.  
  204. # ----------------------------------------------------------------------
  205.  
  206. if ! [ "${VERBOSE}" -eq 0 ]
  207. then
  208.     echo "Args"    > /dev/stderr
  209.     echo "   "  > /dev/stderr
  210.     echo "   WHAT=            ${WHAT[@]}"    > /dev/stderr
  211.     echo "   HOW=             ${HOW}"        > /dev/stderr
  212.     echo "   SHOW=            ${SHOW}"        > /dev/stderr
  213.     echo "   VOLUME=          '${VOLUME}'"    > /dev/stderr
  214.     echo "   BINDIR=          ${BINDIR}"    > /dev/stderr
  215.     echo "   SCRIPTDIR=       ${SCRIPTDIR}"    > /dev/stderr
  216.     echo "   "                                > /dev/stderr
  217.     echo "   INSTALLER=       ${INSTALLER}"    > /dev/stderr
  218.     echo "   CLEAR_PREFS=     ${OPTION_CLEAR_PREFERENCES}"    > /dev/stderr
  219.     echo "   REMOVE_PREFS=    ${OPTION_REMOVE_PREFERENCES}"    > /dev/stderr
  220.     echo "   REMOVE_INSTALLER=${OPTION_REMOVE_INSTALLER}"    > /dev/stderr
  221.     echo "   "  > /dev/stderr
  222. fi
  223.  
  224. # ----------------------------------------------------------------------
  225. # sam levin - macmice - dlink adapter for bluetooth
  226.  
  227. source "${SCRIPTDIR}/UninstallerTools.sh"
  228.  
  229. defineRemoveArgs "${BINDIR}" "${HOW}" "${VOLUME}" "${SHOW}"
  230. locateTools
  231.  
  232.  
  233. if ! [ "${VERBOSE}" -eq 0 ]
  234. then
  235.     showRemoveArgs
  236.     # showRemoveTools
  237. fi
  238.  
  239. # -----------------------------------------------------------------------
  240. # Determine what's installed
  241.  
  242. # Needed to get RECEIPTS location on specified volume
  243. # TODO - best way to determine what's installed is - are any files for a component installed.
  244.  
  245. defineInstallLocations "IOXperts" "IOXperts"
  246.  
  247. HAS_IIDC=0
  248. HAS_WEBCAM=0
  249. HAS_INDUSTRIAL=0
  250. HAS_LOGITECH=0
  251. HAS_WIRELESS=0
  252. HAS_STILL=0
  253.  
  254. #  NOTE - Determine what's installed by 
  255. #  Note that pkg file names are versioned after 1.1b42
  256.  
  257. if [ 1 -eq 0 ]
  258. then
  259.  
  260.     checkForReceipt "WebCam*"
  261.     if test $? -ne 0
  262.     then
  263.         HAS_WEBCAM=1
  264.     fi
  265.  
  266.     checkForReceipt "Webcam*"
  267.     if test $? -ne 0
  268.     then
  269.         HAS_WEBCAM=1
  270.     fi
  271.  
  272.     checkForReceipt "IIDC*"
  273.     if test $? -ne 0
  274.     then
  275.         HAS_IIDC=1
  276.     fi
  277.  
  278.     checkForReceipt "Industrial*"
  279.     if test $? -ne 0 
  280.     then
  281.         HAS_INDUSTRIAL=1
  282.     fi
  283.  
  284.     checkForReceipt "QuickCam*"
  285.     if test $? -ne 0
  286.     then
  287.         HAS_LOGITECH=1
  288.     fi
  289.     # checkForReceipt "Still"
  290.     # checkForReceipt "Wireless"
  291.  
  292. fi
  293.  
  294. # -----------------------------------------------------------------------
  295. # Determine what to remove
  296.  
  297. REMOVE_DM=0
  298. REMOVE_IIDC=0
  299. REMOVE_INDUSTRIAL=0
  300. REMOVE_INDUSTRIAL_CODECS=0
  301. REMOVE_LOGITECH=0
  302. REMOVE_LOGITECH_KEXTS=0
  303. REMOVE_LOGITECH_DM=0
  304. REMOVE_REGISTER=0
  305. REMOVE_SGPANEL=0
  306. REMOVE_STILL=0
  307. REMOVE_STMICRO_STILL=0
  308. REMOVE_VIDEO_COMMON=0
  309. REMOVE_VIDEO_KEXTS=0
  310. REMOVE_WEBCAM=0
  311. REMOVE_WEBCAM_CODECS=0
  312. REMOVE_WIRELESS=0
  313.  
  314.  
  315. # -----------------------------------------------------------------------
  316. # Determine what to remove
  317.  
  318. for ITEM in "${WHAT[@]}"
  319. do
  320.     # echo "Item=${ITEM}"  > /dev/stderr
  321.     
  322.     # -----------------------------------------------------------------
  323.     # Composite items
  324.  
  325.     if [[ "${ITEM}" == "webcam" || "${ITEM}" == "usbwebcam" ]]
  326.     then
  327.         REMOVE_WEBCAM=1
  328.         REMOVE_SGPANEL=1
  329.         REMOVE_VIDEO_COMMON=1
  330.         REMOVE_REGISTER=1
  331.         REMOVE_WEBCAM_CODECS=1
  332.         REMOVE_DM=1
  333.         REMOVE_VIDEO_KEXTS=1
  334.         
  335.     elif  [ "${ITEM}" == "iidc" ]
  336.     then
  337.         REMOVE_IIDC=1
  338.         REMOVE_SGPANEL=1
  339.         REMOVE_VIDEO_COMMON=1
  340.         REMOVE_REGISTER=1
  341.         REMOVE_DM=1
  342.  
  343.     elif [[ "${ITEM}" == "industrial" ]]
  344.     then
  345.         REMOVE_INDUSTRIAL=1
  346.         REMOVE_SGPANEL=1
  347.         REMOVE_VIDEO_COMMON=1
  348.         REMOVE_REGISTER=1
  349.         REMOVE_WEBCAM_CODECS=1
  350.         REMOVE_INDUSTRIAL_CODECS=1
  351.         REMOVE_DM=1
  352.         REMOVE_VIDEO_KEXTS=1
  353.  
  354.     elif  [ "${ITEM}" == "still" ]
  355.     then
  356.         REMOVE_STILL=1
  357.         REMOVE_REGISTER=1
  358.         REMOVE_DM=1
  359.  
  360.     elif [[ "${ITEM}" == "wireless" ]]
  361.     then
  362.         REMOVE_WIRELESS=1
  363.         REMOVE_REGISTER=1
  364.         REMOVE_DM=1
  365.  
  366.     elif [[ "${ITEM}" == "logitech" ]]
  367.     then
  368.         REMOVE_LOGITECH=1
  369.         REMOVE_DM=1
  370.         REMOVE_LOGITECH_DM=1
  371.         REMOVE_LOGITECH_KEXTS=1
  372.  
  373.     elif  [ "${ITEM}" == "stmicro" ]
  374.     then
  375.         REMOVE_STMICRO_STILL=1
  376.         # REMOVE_REGISTER=1
  377.         # REMOVE_DM=1
  378.  
  379.     elif [[ "${ITEM}" == "all" ]]
  380.     then
  381.         REMOVE_WEBCAM=1
  382.         REMOVE_IIDC=1
  383.         REMOVE_INDUSTRIAL=1
  384.         REMOVE_WIRELESS=1
  385.         REMOVE_STILL=1
  386.         
  387.         REMOVE_LOGITECH=1
  388.         REMOVE_LOGITECH_KEXTS=1
  389.  
  390.         REMOVE_STMICRO_STILL=1
  391.         
  392.         REMOVE_VIDEO_COMMON=1
  393.         REMOVE_SGPANEL=1
  394.         REMOVE_VIDEO_KEXTS=1
  395.         REMOVE_REGISTER=1
  396.         REMOVE_INDUSTRIAL_CODECS=1
  397.         REMOVE_WEBCAM_CODECS=1
  398.         REMOVE_DM=1
  399.  
  400.     elif [[ "${ITEM}" == "ioxperts" ]]
  401.     then
  402.         REMOVE_WEBCAM=1
  403.         REMOVE_IIDC=1
  404.         REMOVE_INDUSTRIAL=1
  405.         REMOVE_WIRELESS=1
  406.         REMOVE_STILL=1
  407.         
  408.         REMOVE_VIDEO_COMMON=1
  409.         REMOVE_SGPANEL=1
  410.         REMOVE_VIDEO_KEXTS=1
  411.         REMOVE_REGISTER=1
  412.         REMOVE_INDUSTRIAL_CODECS=1
  413.         REMOVE_WEBCAM_CODECS=1
  414.         REMOVE_DM=1
  415.  
  416.  
  417.     # -----------------------------------------------------------------
  418.     # Individual items
  419.     
  420.     elif [ "${ITEM}" == "webcam-vdigs" ]
  421.     then
  422.         REMOVE_WEBCAM=1
  423.  
  424.     elif [ "${ITEM}" == "iidc-vdigs" ]
  425.     then
  426.         REMOVE_IIDC=1
  427.  
  428.     elif [ "${ITEM}" == "industrial-vdigs" ]
  429.     then
  430.         REMOVE_INDUSTRIAL=1
  431.  
  432.     elif [ "${ITEM}" == "logitech-vdigs" ]
  433.     then
  434.         REMOVE_LOGITECH=1
  435.  
  436.     elif [ "${ITEM}" == "wireless-kexts" ]
  437.     then
  438.         REMOVE_WIRELESS=1
  439.  
  440.     elif [ "${ITEM}" == "still-capture" ]
  441.     then
  442.         REMOVE_STILL=1
  443.  
  444.     elif [ "${ITEM}" == "stmicro-still-capture" ]
  445.     then
  446.         REMOVE_STMICRO_STILL=1
  447.  
  448.     elif [[ "${ITEM}" == "shared" || "${ITEM}" == "common" ]]
  449.     then
  450.         REMOVE_VIDEO_COMMON=1
  451.  
  452.     elif [[ "${ITEM}" == "register" || "${ITEM}" == "purchase" ]]
  453.     then
  454.         REMOVE_REGISTER=1
  455.     
  456.     elif [[ "${ITEM}" == "DM" || "${ITEM}" == "dm" ]]
  457.     then
  458.         REMOVE_DM=1
  459.     
  460.     elif [[ "${ITEM}" == "Logitech-DM" || "${ITEM}" == "logitech-dm" ]]
  461.     then
  462.         REMOVE_LOGITECH_DM=1
  463.     
  464.     elif [[ "${ITEM}" == "sgpanel" ]]
  465.     then
  466.         REMOVE_SGPANEL=1
  467.     
  468.     elif [[ "${ITEM}" == "codecs" ]]
  469.     then
  470.         REMOVE_WEBCAM_CODECS=1
  471.     
  472.     elif [[ "${ITEM}" == "industrial-codecs" ]]
  473.     then
  474.         REMOVE_INDUSTRIAL_CODECS=1
  475.     
  476.     elif [[ "${ITEM}" == "video-kexts" ]]
  477.     then
  478.         REMOVE_VIDEO_KEXTS=1
  479.     
  480.     elif [[ "${ITEM}" == "logitech-kexts" ]]
  481.     then
  482.         REMOVE_LOGITECH_KEXTS=1
  483.  
  484.     fi
  485.  
  486. done
  487.  
  488. # -----------------------------------------------------------------------
  489. # Determine what to retain
  490. # If multiple products installed, don't remove shared components unless
  491. # UNLESS we are in installer 
  492.  
  493.  
  494. # -------------------------------------------------------------
  495. # Show what will be procesed
  496.  
  497. if ! [ "${VERBOSE}" -eq 0 ]
  498. then
  499.     echo "    REMOVE_DM=${REMOVE_DM}"                            > /dev/stderr
  500.     echo "    REMOVE_IIDC=${REMOVE_IIDC}"                        > /dev/stderr
  501.     echo "    REMOVE_INDUSTRIAL=${REMOVE_INDUSTRIAL}"            > /dev/stderr
  502.     echo "    REMOVE_INDUSTRIAL_CODECS=${REMOVE_INDUSTRIAL_CODECS}" > /dev/stderr
  503.     echo "    REMOVE_LOGITECH=${REMOVE_LOGITECH}"                > /dev/stderr
  504.     echo "    REMOVE_LOGITECH_DM=${REMOVE_LOGITECH_DM}"            > /dev/stderr
  505.     echo "    REMOVE_LOGITECH_KEXTS=${REMOVE_LOGITECH_KEXTS}"   > /dev/stderr
  506.     echo "    REMOVE_REGISTER=${REMOVE_REGISTER}"                > /dev/stderr
  507.     echo "    REMOVE_SGPANEL=${REMOVE_SGPANEL}"                    > /dev/stderr
  508.     echo "    REMOVE_STILL=${REMOVE_STILL}"                        > /dev/stderr
  509.     echo "    REMOVE_STMICRO_STILL=${REMOVE_STMICRO_STILL}"     > /dev/stderr
  510.     echo "    REMOVE_VIDEO_COMMON=${REMOVE_VIDEO_COMMON}"        > /dev/stderr
  511.     echo "    REMOVE_VIDEO_KEXTS=${REMOVE_VIDEO_KEXTS}"            > /dev/stderr
  512.     echo "    REMOVE_WEBCAM=${REMOVE_WEBCAM}"                    > /dev/stderr
  513.     echo "    REMOVE_WEBCAM_CODECS=${REMOVE_WEBCAM_CODECS}"        > /dev/stderr
  514.     echo "    REMOVE_WIRELESS=${REMOVE_WIRELESS}"                > /dev/stderr
  515.     echo "    "
  516. fi
  517.  
  518.  
  519. # -----------------------------------------------------------------------------------------
  520. # Process IOXperts Installations
  521. # -----------------------------------------------------------------------------------------
  522.  
  523. if ! [ "${VERBOSE}" -eq 0 ]
  524. then
  525.     echo "Removing Files"    > /dev/stderr
  526. fi
  527.  
  528. # -------------------------------------------------------------
  529. # Define directories for IOXperts Installations
  530.  
  531. defineInstallLocations "IOXperts" "IOXperts"
  532.  
  533. # -------------------------------------------------------------
  534. # Kill running apps as appropriate
  535.  
  536.  
  537. echo ">>>>>>Before Killing Apps"
  538.  
  539.  
  540. if [ "${REMOVE_REGISTER}" != 0 ]
  541. then
  542.     killRegisterApp
  543. fi
  544. if [[ "${REMOVE_REGISTER}" != 0 || "${REMOVE_VIDEO_COMMON}" != 0 ]]
  545. then
  546.     killSessionMonitor
  547. fi
  548. if [ "${REMOVE_DM}" != 0 ]
  549. then
  550.     killDeviceMonitor
  551. fi
  552. if [ "${REMOVE_LOGITECH_DM}" != 0 ]
  553. then
  554.     killDeviceMonitor logitech
  555. fi
  556.  
  557. # -------------------------------------------------------------
  558. # IOXperts Register
  559. #
  560.  
  561. echo ">>>>>>Before REMOVE_REGISTER"
  562.  
  563. if [ "${REMOVE_REGISTER}" != 0 ]
  564. then    
  565.     removeActionVariants "${APPLICATION_SUPPORT_DIR}/IOXperts Register"          ".app"
  566.     removeActionVariants "${APPLICATION_SUPPORT_DIR}/IOXperts Purchase"          ".app"
  567.  
  568.     # Application Support/bin  - 1.1b43 and later
  569.     removeActionVariants "${APPLICATION_SUPPORT_BIN_DIR}/IOXperts Register"   ".app"
  570.  
  571.     # Interrim betas 1.1b42-b43
  572.     removeActionVariants "${APPLICATION_SUPPORT_BIN_DIR_OLD}/IOXperts Register"   ".app"
  573.     removeActionVariants "${APPLICATION_SUPPORT_BIN_DIR_OLD_2}/IOXperts Register" ".app"
  574.  
  575.     # Prefs for sessiond
  576.     if [ "${OPTION_REMOVE_PREFERENCES}" != 0 ]
  577.     then
  578.         removeActionGlob "${PREFERENCES_DIR}/com.ioxperts.common.plist"
  579.         removeActionGlob "${PREFERENCES_DIR}/com.ioxperts.common.1.1.plist"
  580.     fi
  581.     
  582.     # Prefs for sessiond
  583.     if [ "${OPTION_CLEAR_PREFERENCES}" != 0 ]
  584.     then
  585.         echo "    TODO - clear any launch prefs for Purchase/Register"     > /dev/stderr
  586.     fi
  587.     
  588. fi
  589.  
  590. # -------------------------------------------------------------
  591. # IOXpers Video Common
  592. #
  593.  
  594. echo ">>>>>>Before REMOVE_VIDEO_COMMON"
  595.  
  596. if [ "${REMOVE_VIDEO_COMMON}" != 0 ]
  597. then    
  598.     # Applications/IOXperts
  599.     removeActionVariants "${APPLICATION_DIR}/IOXperts Camera Control"          ".app"
  600.     removeActionVariants "${APPLICATION_DIR}/Camera Identifier"                  ".app"
  601.     removeActionVariants "${APPLICATION_DIR}/IOXperts Camera Identifier"      ".app"
  602.     
  603.     # Application Support
  604.     removeActionVariants "${APPLICATION_SUPPORT_DIR}/ioxsessiond"             ".app"
  605.     removeActionVariants "${APPLICATION_SUPPORT_DIR}/SetInstallationPrefs"    ""
  606.  
  607.     # Application Support/bin  - 1.1b43 and later
  608.     removeActionVariants "${APPLICATION_SUPPORT_BIN_DIR}/ioxsessiond"         ".app"
  609.     
  610.     # Interrim betas 1.1b42-b43
  611.     removeActionVariants "${APPLICATION_SUPPORT_BIN_DIR_OLD}/ioxsessiond"     ".app"
  612.     removeActionVariants "${APPLICATION_SUPPORT_BIN_DIR_OLD_2}/ioxsessiond"   ".app"
  613.  
  614.     # Kexts
  615.     removeActionVariants "${SYSTEM_EXTENSIONS_DIR}/IOXpertsWebCam"              ".kext"
  616.     removeActionVariants "${SYSTEM_EXTENSIONS_DIR}/IOXpertsWebcam"              ".kext"
  617.     
  618.     # Remove prefs for sessiond
  619.     if [ "${OPTION_REMOVE_PREFERENCES}" != 0 ]
  620.     then
  621.         removeActionGlob "${PREFERENCES_DIR}/com.ioxperts.common.plist"
  622.         removeActionGlob "${PREFERENCES_DIR}/com.ioxperts.common.1.1.plist"
  623.     fi
  624.     
  625.     # Prefs for sessiond
  626.     if [ "${OPTION_CLEAR_PREFERENCES}" != 0 ]
  627.     then
  628.         echo "    TODO - clear our login item from loginwindow.plist"     > /dev/stderr
  629.         echo "    TODO - clear global launch prefs for SM/Identifier/"     > /dev/stderr
  630.     fi
  631.     
  632. fi
  633.  
  634. # -------------------------------------------------------------
  635.  
  636. echo ">>>>>>Before REMOVE_DM"
  637.  
  638. if [ "${REMOVE_DM}" != 0 ]
  639. then    
  640.     # /Library/StartupItems
  641.     # /System/Library/StartupItems  - 1.1 - Sept 04 and later
  642.     removeAction         "${STARTUP_ITEMS}/IOXpertsDeviceMonitor"
  643.     removeAction         "${SYSTEM_STARTUP_ITEMS}/IOXpertsDeviceMonitor"
  644.     
  645.     # Application Support  - 1.1 - Sept 04 and earlier
  646.     removeActionVariants "${APPLICATION_SUPPORT_DIR}/IOXperts Device Monitor" ".app"
  647.  
  648.     # Prefs for DM
  649.     if [ "${OPTION_REMOVE_PREFERENCES}" != 0 ]
  650.     then
  651.         removeActionGlob "${PREFERENCES_DIR}/com.ioxperts.devicemonitor.plist"
  652.     fi
  653.     
  654.     # Clear Prefs for DM
  655.     if [ "${OPTION_CLEAR_PREFERENCES}" != 0 ]
  656.     then
  657.         echo "    TODO - save (mvmac) to new filename"
  658.         # "${PREFERENCES_DIR}/com.ioxperts.devicemonitor.plist"
  659.     fi
  660. fi
  661.  
  662. # -------------------------------------------------------------
  663.  
  664. echo ">>>>>>Before REMOVE_LOGITECH_DM"
  665.  
  666. if [ "${REMOVE_LOGITECH_DM}" != 0 ]
  667. then
  668.     # /Library/StartupItems
  669.     removeAction         "${STARTUP_ITEMS}/LogitechDeviceMonitor"
  670.  
  671.     # Prefs for DM
  672.     if [ "${OPTION_REMOVE_PREFERENCES}" != 0 ]
  673.     then
  674.         removeActionGlob "${PREFERENCES_DIR}/com.logitech.devicemonitor.plist"
  675.     fi
  676.     
  677. fi
  678.  
  679. # -------------------------------------------------------------
  680. # Remove application dir if emptied
  681.  
  682. echo ">>>>>>Before Remove empty APPLICATION_DIR"
  683. removeEmptyDir "${APPLICATION_DIR}"
  684.  
  685. # -------------------------------------------------------------
  686. # Remove applications support bin dir if emptied
  687.  
  688. echo ">>>>>>Before Remove empty APPLICATION_SUPPORT_BIN_DIR '${APPLICATION_SUPPORT_BIN_DIR}'"
  689. removeEmptyDir "${APPLICATION_SUPPORT_BIN_DIR}"
  690.  
  691. echo ">>>>>>Before Remove empty APPLICATION_SUPPORT_BIN_DIR_OLD '${APPLICATION_SUPPORT_BIN_DIR_OLD}'"
  692. removeEmptyDir "${APPLICATION_SUPPORT_BIN_DIR_OLD}"
  693.  
  694. echo ">>>>>>Before Remove empty APPLICATION_SUPPORT_BIN_DIR_OLD_2 '${APPLICATION_SUPPORT_BIN_DIR_OLD_2}'"
  695. removeEmptyDir "${APPLICATION_SUPPORT_BIN_DIR_OLD_2}"
  696.  
  697.  
  698. # -------------------------------------------------------------
  699. # Remove Kexts Below here
  700. # -------------------------------------------------------------
  701.  
  702. echo ">>>>>>Before REMOVE_VIDEO_KEXTS"
  703.  
  704. if [ "${REMOVE_VIDEO_KEXTS}" != 0 ]
  705. then
  706.     removeAction "${SYSTEM_EXTENSIONS_DIR}/IOXpertsWebcam.kext"
  707. fi
  708.  
  709. # -------------------------------------------------------------
  710.  
  711. echo ">>>>>>Before REMOVE_LOGITECH_KEXTS"
  712.  
  713. if [ "${REMOVE_LOGITECH_KEXTS}" != 0 ]
  714. then
  715.     removeAction "${SYSTEM_EXTENSIONS_DIR}/LogitechQuickCam.kext"
  716. fi
  717.  
  718. # -------------------------------------------------------------
  719. # Remove Components Below here
  720. # -------------------------------------------------------------
  721.  
  722. echo ">>>>>>Before REMOVE_SGPANEL"
  723.  
  724. if [ "${REMOVE_SGPANEL}" != 0 ]
  725. then
  726.     removeActionVariants "${COMPONENTS_DIR}/IOXperts SGPanel"          ".component"
  727.     removeActionVariants "${COMPONENTS_DIR}/IOXperts Video Support"      ".component"
  728.     
  729.     # Prefs for sessiond
  730.     if [ "${OPTION_REMOVE_PREFERENCES}" != 0 ]
  731.     then
  732.         echo " "
  733.     fi
  734.  
  735.     # Clear Prefs for DM
  736.     if [ "${OPTION_CLEAR_PREFERENCES}" != 0 ]
  737.     then
  738.         echo " "
  739.         # "${PREFERENCES_DIR}/com.ioxperts.devicemonitor.plist"
  740.     fi
  741. fi
  742.  
  743. # -------------------------------------------------------------
  744.  
  745. echo ">>>>>>Before REMOVE_WEBCAM_CODECS"
  746.  
  747. if [ "${REMOVE_WEBCAM_CODECS}" != 0 ]
  748. then
  749.     removeAction "${COMPONENTS_DIR}/IOXperts IIDC Codec.component"
  750. fi
  751.  
  752. # -------------------------------------------------------------
  753.  
  754. echo ">>>>>>Before REMOVE_INDUSTRIAL_CODECS"
  755.  
  756. if [ "${REMOVE_INDUSTRIAL_CODECS}" != 0 ]
  757. then
  758.     removeAction "${COMPONENTS_DIR}/IOXperts Bayer Codec.component"
  759. fi
  760.  
  761. # -------------------------------------------------------------
  762.  
  763. echo ">>>>>>Before REMOVE_WEBCAM"
  764.  
  765. if [ "${REMOVE_WEBCAM}" != 0 ]
  766. then
  767.  
  768.     removeActionVariants "${COMPONENTS_DIR}/IOXperts WebCam" ".component"
  769.     removeActionVariants "${COMPONENTS_DIR}/IOXperts Webcam" ".component"
  770.     
  771.     removeActionCustomizedComponents
  772.  
  773.     if [ "${OPTION_REMOVE_PREFERENCES}" != 0 ]
  774.     then
  775.         echo "    TODO - find and remove Webcam Prefs"            > /dev/stderr
  776.         removeActionGlob "${PREFERENCES_DIR}/com.ioxperts.webcam*"
  777.         removeActionGlob "${HOME_PREFERENCES_DIR}/com.ioxperts.*"
  778.     fi
  779.     
  780.     # Prefs for sessiond
  781.     if [ "${OPTION_REMOVE_INSTALLER}" != 0 ]
  782.     then
  783.         removeActionGlob "${RECEIPTS_DIR}/WebCam*.pkg"
  784.         removeActionGlob "${RECEIPTS_DIR}/Webcam*.pkg"
  785.     fi
  786.     
  787. fi
  788.  
  789. # -------------------------------------------------------------
  790.  
  791. echo ">>>>>>Before REMOVE_IIDC"
  792.  
  793. if [ "${REMOVE_IIDC}" != 0 ]
  794. then
  795.     
  796.     # Library/Components
  797.     removeActionVariants "${COMPONENTS_DIR}/IOXperts FWDCam" ".component"
  798.     removeActionCustomizedComponents
  799.     
  800.     # Prefs for sessiond
  801.     if [ "${OPTION_REMOVE_INSTALLER}" != 0 ]
  802.     then
  803.         removeActionGlob "${RECEIPTS_DIR}/IIDC*.pkg"
  804.     fi
  805. fi
  806.  
  807. # -------------------------------------------------------------
  808.  
  809. echo ">>>>>>Before REMOVE_INDUSTRIAL"
  810.  
  811. if [ "${REMOVE_INDUSTRIAL}" != 0 ]
  812. then
  813.     removeActionVariants "${COMPONENTS_DIR}/IOXperts Industrial Camera" ".component"
  814.     
  815.     # Prefs for sessiond
  816.     if [ "${OPTION_REMOVE_INSTALLER}" != 0 ]
  817.     then
  818.         removeActionGlob "${RECEIPTS_DIR}/Industrial*.pkg"
  819.     fi
  820.     
  821. fi
  822.  
  823. # -------------------------------------------------------------
  824.  
  825. echo ">>>>>>Before REMOVE_STILL"
  826.  
  827. if [ "${REMOVE_STILL}" != 0 ]
  828. then
  829.     echo "    TODO - find and remove still, " > /dev/stderr
  830.     # removeActionVariants "${IMAGE_CAPTURE_DIR}/USBStillCamera"                 ".app"
  831.     # removeActionVariants "${IMAGE_CAPTURE_DIR}/IOXpertsUSBStillCamera-Logging" ".app"
  832. fi
  833.  
  834. # -------------------------------------------------------------
  835.  
  836. echo ">>>>>>Before REMOVE_WIRELESS"
  837.  
  838. if [ "${REMOVE_WIRELESS}" != 0 ]
  839. then
  840.     echo "    TODO - find and remove wireless kexts, components, " > /dev/stderr
  841.  
  842.     if [ "${OPTION_REMOVE_PREFERENCES}" != 0 ]
  843.     then
  844.         echo "    TODO - find and remove wireless Prefs" > /dev/stderr
  845.     fi
  846.     
  847.     if [ "${OPTION_CLEAR_PREFERENCES}" != 0 ]
  848.     then
  849.         echo "    TODO - clear specific prefs that affect the new wireless installation." > /dev/stderr
  850.     fi
  851.     
  852.     # Prefs for sessiond
  853.     if [ "${OPTION_REMOVE_INSTALLER}" != 0 ]
  854.     then
  855.         echo "    TODO - find and remove wireless pkg" > /dev/stderr
  856.         # removeActionGlob "${RECEIPTS_DIR}/WebCam*.pkg"
  857.     fi
  858.     
  859. fi
  860.  
  861. # -----------------------------------------------------------------------------------------
  862. # Process STMicro Installations
  863. # -----------------------------------------------------------------------------------------
  864.  
  865. echo ">>>>>>Before STMicro"
  866.  
  867. defineInstallLocations "IOXperts" "IOXperts"
  868.  
  869. # -------------------------------------------------------------
  870.  
  871. echo ">>>>>>Before REMOVE_STMICRO_STILL"
  872.  
  873. if [ "${REMOVE_STMICRO_STILL}" != 0 ]
  874. then
  875.     echo "    TODO - find and remove stmicro still, " > /dev/stderr
  876.     # removeActionVariants "${IMAGE_CAPTURE_DIR}/USBStillCamera"                 ".app"
  877.     # removeActionVariants "${IMAGE_CAPTURE_DIR}/IOXpertsUSBStillCamera-Logging" ".app"
  878. fi
  879.  
  880.  
  881. # -----------------------------------------------------------------------------------------
  882. # Process Logitech Installations
  883. # -----------------------------------------------------------------------------------------
  884. # Logitech is in a separate section because it uses has its own Application and Application Support
  885. # directories.
  886.  
  887. echo ">>>>>>Before Logitech"
  888.  
  889. defineInstallLocations "Logitech QuickCam" "Logitech"
  890.  
  891. # -------------------------------------------------------------
  892. # NOTE - Logitech QuickCam also requires removal of the DM for
  893. #         clean removal.
  894. # NOTE - Logitech does not use SM, Register, Purchase, or Identifier App.
  895.  
  896. echo ">>>>>>Before REMOVE_LOGITECH"
  897.  
  898. if [ "${REMOVE_LOGITECH}" != 0 ]
  899. then
  900.     
  901.     removeActionVariants "${APPLICATION_DIR}/Logitech Camera Control"        ".app"
  902.     removeActionVariants "${APPLICATION_DIR}/QuickCapture"                    ".app"
  903.     removeActionVariants "${APPLICATION_SUPPORT_DIR}/SetInstallationPrefs"    ""
  904.     removeActionVariants "${COMPONENT_DIR}/Logitech QuickCam"                ".qtx"
  905.     # TODO - separate removal for logitech kexts
  906.     removeActionVariants "${SYSTEM_EXTENSIONS_DIR}/LogitechQuickCam"        ".kext"
  907.  
  908.     # Preferences
  909.     if [ "${OPTION_REMOVE_PREFERENCES}" != 0 ]
  910.     then
  911.         removeActionGlob "${PREFERENCES_DIR}/com.logitech.*"
  912.         removeActionGlob "${HOME_PREFERENCES_DIR}/com.logitech.*"
  913.     fi
  914.     
  915.     # Installer
  916.     if [ "${OPTION_REMOVE_INSTALLER}" != 0 ]
  917.     then
  918.         removeActionGlob "${RECEIPTS_DIR}/QuickCam*.pkg"
  919.     fi
  920.  
  921. fi
  922.  
  923.  
  924. # -------------------------------------------------------------
  925. # Remove application dir if emptied
  926.  
  927. echo ">>>>>>Before Logitech Remove APPLICATION_DIR '${APPLICATION_DIR}'"
  928. removeEmptyDir "${APPLICATION_DIR}"
  929.  
  930. # -------------------------------------------------------------
  931. # Remove applications support bin dir if emptied
  932.  
  933. if [ 1 -eq 0 ]
  934. then
  935.  
  936.     echo ">>>>>>Before Logitech Remove empty APPLICATION_SUPPORT_BIN_DIR '${APPLICATION_SUPPORT_BIN_DIR}'"
  937.     removeEmptyDir "${APPLICATION_SUPPORT_BIN_DIR}"
  938.  
  939.     echo ">>>>>>Before Logitech Remove empty APPLICATION_SUPPORT_BIN_DIR_OLD '${APPLICATION_SUPPORT_BIN_DIR_OLD}'"
  940.     removeEmptyDir "${APPLICATION_SUPPORT_BIN_DIR_OLD}"
  941.  
  942.     echo ">>>>>>Before Logitech Remove empty APPLICATION_SUPPORT_BIN_DIR_OLD_2 '${APPLICATION_SUPPORT_BIN_DIR_OLD_2}'"
  943.     removeEmptyDir "${APPLICATION_SUPPORT_BIN_DIR_OLD_2}"
  944.  
  945. fi
  946.  
  947.  
  948.